<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<div style="text-align: center">
		<form action="save" method="post">
			<input type="hidden" name="id"> <label for="name">Person
				Name</label> <input type="text" id="name" name="name" /> <input
				type="submit" value="Submit" />
		</form>

		<table
			style="border: 1px solid #D3D3D3; margin-top: 20px; margin-left: 28%">
			<tr style="color: #4682B4; font-size: 20px; text-align: center;">
				<td>Id</td>
				<td>Name</td>

			</tr>
			<c:forEach var="person" items="${personList}">
				<form action="update" method="post">
					<tr>
						<td>${person.id}<input type="hidden" name="id"
							value="${person.id}" />
						</td>
						<td><input type="text" id="name" name="name"
							value="${person.name}" /></td>
						<td><input type="submit" value="Update" /></td>
						<td><input type="button" value="delete"
							onclick="window.location='delete?id=${person.id}'" /></td>
					</tr>
				</form>
			</c:forEach>
		</table>

		<!--new   -->
		<form action="findByName" method="get" style="margin-top: 20px;">
			<label for="name">Find Person By Name</label> <input type="text"
				id="name" name="name" /> <input type="submit" value="Submit" />
		</form>
		<table
			style="border: 1px solid #D3D3D3; margin-top: 20px; margin-left: 28%">
			<tr style="color: #4682B4; font-size: 20px; text-align: center;">
				<td>Id</td>
				<td>Name</td>

			</tr>
			<c:forEach var="person" items="${personListByName}">
				<form action="update" method="post">
					<tr>
						<td>${person.id}<input type="hidden" name="id"
							value="${person.id}" />
						</td>
						<td><input type="text" id="name" name="name"
							value="${person.name}" /></td>
						<td><input type="submit" value="Update" /></td>
						<td><input type="button" value="delete"
							onclick="window.location='delete?id=${person.id}'" /></td>
					</tr>
				</form>
			</c:forEach>
		</table>

	</div>
</body>
</html>